
var t = n =0, count;
	$(document).ready(function(){ 
		count=$("#banner_list a").length;
		$("#banner_list a:not(:first-child)").hide();
		$("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt'));
		$("#banner_info").click(function(){window.open($("#banner_list a:first-child").attr('href'), "_blank");});
		$("#banner li").click(function() {
		var i = $(this).text() -1;//获取Li元素内的值，即1，2，3，4
		n = i;
		if (i >= count) return;
		$("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
		$("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank");});
		$("#banner_list a").filter(":visible").fadeOut(250).parent().children().eq(i).fadeIn(500);
		document.getElementById("banner").style.background="";
		$(this).toggleClass("on");
		$(this).siblings().removeAttr("class");
		});
		t = setInterval("showAuto()", 2000);
		$("#banner").hover(function(){clearInterval(t);}, function(){t = setInterval("showAuto()", 2000);});
	});
	
	function showAuto(){
		n = n >=(count -1) ?0 : ++n;
		$("#banner li").eq(n).trigger('click');
	}
	$(function(){
  		$(".cd-read-more").click(function(){
  			var title=$(this).siblings("#dateOne").text();
  			var content=$(this).siblings("#dateTwo").text();
  			var albumid=$("input[type='hidden']").val();
	  		$.ajax(
				{
					url:"student/ActiveContent.do",
					type:"post",
					data:{
						title:title,
						content:content,
						albumid:albumid
					},
					success:function(data){
						var result = JSON.parse(data);
						var img=$("#banner_list").children("a").children("img");
				        for (var i = 0; i <img.length; i++) {
				        	img[i].src="image/f/1.jpg"; 
						}
						$(".life").children("h1").text(result.at) ;
						$(".life").children("p").text(result.slc) ;
					}
				}
			);
  			$(".position").show();
  			return false;
  		});
  		$(".close").click(function(){
  			$(".position").hide();
  			return false;
  		});
  		
  		var page=2;
  		$("#more").click(function(){
  			$.get("student/lifeMore.do?page="+page,function(data,status){
				$("#cd-timeline").html($("#cd-timeline").html()+data);
			});
			page++;
  		});
	});